//  网站设置提交
$('.settingForm').on('submit',function() {
  let formdata = $(this).serialize()
  $.ajax({
    type: 'post',
    url: '/settings',
    data: formdata,
    success: function(response) {
      location.reload()
    },
    error: function(res) {
      console.log(res)
    }
  })
  return false
})
$('.settingFile').on('change', function() {
  let formData = new FormData()
  formData.append('avatar', this.files[0])
  $.ajax({
    type: 'post',
    url: '/upload',
    data: formData,
    processData: false,
    contentType: false,
    success: function(response) {
      $('#settingHidden').val(response[0].avatar)
      $('#prveiewLogo').attr('src', response[0].avatar)
    }
  })
})